// Copyright 2018-2021 Polyaxon, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * Polyaxon SDKs and REST API specification.
 * Polyaxon SDKs and REST API specification.
 *
 * The version of the OpenAPI document: 1.7.4
 * Contact: contact@polyaxon.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */


import ApiClient from "../ApiClient";
import RuntimeError from '../model/RuntimeError';
import V1EntityStageBodyRequest from '../model/V1EntityStageBodyRequest';
import V1ListActivitiesResponse from '../model/V1ListActivitiesResponse';
import V1ListModelRegistriesResponse from '../model/V1ListModelRegistriesResponse';
import V1ListModelVersionsResponse from '../model/V1ListModelVersionsResponse';
import V1ModelRegistry from '../model/V1ModelRegistry';
import V1ModelRegistrySettings from '../model/V1ModelRegistrySettings';
import V1ModelVersion from '../model/V1ModelVersion';
import V1Stage from '../model/V1Stage';

/**
* ModelRegistryV1 service.
* @module api/ModelRegistryV1Api
* @version 1.7.4
*/
export default class ModelRegistryV1Api {

    /**
    * Constructs a new ModelRegistryV1Api. 
    * Polyaxon sdk
    * @alias module:api/ModelRegistryV1Api
    * @class
    * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
    * default to {@link module:ApiClient#instance} if unspecified.
    */
    constructor(apiClient) {
        this.apiClient = apiClient || ApiClient.instance;
    }


    /**
     * Callback function to receive the result of the archiveModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~archiveModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Archive registry model
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ModelRegistryV1Api~archiveModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     */
    archiveModelRegistry(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling archiveModelRegistry");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling archiveModelRegistry");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}/archive', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the bookmarkModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~bookmarkModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Bookmark registry model
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ModelRegistryV1Api~bookmarkModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     */
    bookmarkModelRegistry(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling bookmarkModelRegistry");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling bookmarkModelRegistry");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}/bookmark', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the createModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~createModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelRegistry} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Create registry model
     * @param {String} owner Owner of the namespace
     * @param {module:model/V1ModelRegistry} body Model body
     * @param {module:api/ModelRegistryV1Api~createModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelRegistry}
     */
    createModelRegistry(owner, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling createModelRegistry");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling createModelRegistry");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ModelRegistry;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/create', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the createModelVersion operation.
     * @callback module:api/ModelRegistryV1Api~createModelVersionCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelVersion} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Create model version
     * @param {String} owner Owner of the namespace
     * @param {String} model Model name
     * @param {module:model/V1ModelVersion} body Model version body
     * @param {module:api/ModelRegistryV1Api~createModelVersionCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelVersion}
     */
    createModelVersion(owner, model, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling createModelVersion");
      }
      // verify the required parameter 'model' is set
      if (model === undefined || model === null) {
        throw new Error("Missing the required parameter 'model' when calling createModelVersion");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling createModelVersion");
      }

      let pathParams = {
        'owner': owner,
        'model': model
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ModelVersion;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{model}/versions', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the createModelVersionStage operation.
     * @callback module:api/ModelRegistryV1Api~createModelVersionStageCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1Stage} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Create new model version stage
     * @param {String} owner Owner of the namespace
     * @param {String} entity Entity namespace
     * @param {String} name Name of the version to apply the stage to
     * @param {module:model/V1EntityStageBodyRequest} body 
     * @param {module:api/ModelRegistryV1Api~createModelVersionStageCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1Stage}
     */
    createModelVersionStage(owner, entity, name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling createModelVersionStage");
      }
      // verify the required parameter 'entity' is set
      if (entity === undefined || entity === null) {
        throw new Error("Missing the required parameter 'entity' when calling createModelVersionStage");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling createModelVersionStage");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling createModelVersionStage");
      }

      let pathParams = {
        'owner': owner,
        'entity': entity,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1Stage;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{entity}/versions/{name}/stages', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the deleteModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~deleteModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Delete registry model
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ModelRegistryV1Api~deleteModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     */
    deleteModelRegistry(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling deleteModelRegistry");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling deleteModelRegistry");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the deleteModelVersion operation.
     * @callback module:api/ModelRegistryV1Api~deleteModelVersionCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Delete model version
     * @param {String} owner Owner of the namespace
     * @param {String} entity Entity: project name, hub name, registry name, ...
     * @param {String} name Sub-entity name
     * @param {module:api/ModelRegistryV1Api~deleteModelVersionCallback} callback The callback function, accepting three arguments: error, data, response
     */
    deleteModelVersion(owner, entity, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling deleteModelVersion");
      }
      // verify the required parameter 'entity' is set
      if (entity === undefined || entity === null) {
        throw new Error("Missing the required parameter 'entity' when calling deleteModelVersion");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling deleteModelVersion");
      }

      let pathParams = {
        'owner': owner,
        'entity': entity,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{entity}/versions/{name}', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~getModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelRegistry} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get registry model
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ModelRegistryV1Api~getModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelRegistry}
     */
    getModelRegistry(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getModelRegistry");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getModelRegistry");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ModelRegistry;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getModelRegistryActivities operation.
     * @callback module:api/ModelRegistryV1Api~getModelRegistryActivitiesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListActivitiesResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get model activities
     * @param {String} owner Owner of the namespace
     * @param {String} name Entity managing the resource
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {String} opts.mode Mode the search.
     * @param {module:api/ModelRegistryV1Api~getModelRegistryActivitiesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListActivitiesResponse}
     */
    getModelRegistryActivities(owner, name, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getModelRegistryActivities");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getModelRegistryActivities");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query'],
        'mode': opts['mode']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListActivitiesResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}/activities', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getModelRegistrySettings operation.
     * @callback module:api/ModelRegistryV1Api~getModelRegistrySettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelRegistrySettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get registry model settings
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ModelRegistryV1Api~getModelRegistrySettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelRegistrySettings}
     */
    getModelRegistrySettings(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getModelRegistrySettings");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getModelRegistrySettings");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ModelRegistrySettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}/settings', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getModelVersion operation.
     * @callback module:api/ModelRegistryV1Api~getModelVersionCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelVersion} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get model version
     * @param {String} owner Owner of the namespace
     * @param {String} entity Entity: project name, hub name, registry name, ...
     * @param {String} name Sub-entity name
     * @param {module:api/ModelRegistryV1Api~getModelVersionCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelVersion}
     */
    getModelVersion(owner, entity, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getModelVersion");
      }
      // verify the required parameter 'entity' is set
      if (entity === undefined || entity === null) {
        throw new Error("Missing the required parameter 'entity' when calling getModelVersion");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getModelVersion");
      }

      let pathParams = {
        'owner': owner,
        'entity': entity,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ModelVersion;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{entity}/versions/{name}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getModelVersionStages operation.
     * @callback module:api/ModelRegistryV1Api~getModelVersionStagesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1Stage} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get model version stages
     * @param {String} owner Owner of the namespace
     * @param {String} entity Entity: project name, hub name, registry name, ...
     * @param {String} name Sub-entity name
     * @param {module:api/ModelRegistryV1Api~getModelVersionStagesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1Stage}
     */
    getModelVersionStages(owner, entity, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getModelVersionStages");
      }
      // verify the required parameter 'entity' is set
      if (entity === undefined || entity === null) {
        throw new Error("Missing the required parameter 'entity' when calling getModelVersionStages");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getModelVersionStages");
      }

      let pathParams = {
        'owner': owner,
        'entity': entity,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1Stage;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{entity}/versions/{name}/stages', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listModelRegistries operation.
     * @callback module:api/ModelRegistryV1Api~listModelRegistriesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListModelRegistriesResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List registry models
     * @param {String} owner Owner of the namespace
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {module:api/ModelRegistryV1Api~listModelRegistriesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListModelRegistriesResponse}
     */
    listModelRegistries(owner, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listModelRegistries");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListModelRegistriesResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/list', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listModelRegistryNames operation.
     * @callback module:api/ModelRegistryV1Api~listModelRegistryNamesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListModelRegistriesResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List registry model names
     * @param {String} owner Owner of the namespace
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {module:api/ModelRegistryV1Api~listModelRegistryNamesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListModelRegistriesResponse}
     */
    listModelRegistryNames(owner, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listModelRegistryNames");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListModelRegistriesResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/names', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listModelVersionNames operation.
     * @callback module:api/ModelRegistryV1Api~listModelVersionNamesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListModelVersionsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List model versions names
     * @param {String} owner Owner of the namespace
     * @param {String} name Entity managing the resource
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {String} opts.mode Mode the search.
     * @param {module:api/ModelRegistryV1Api~listModelVersionNamesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListModelVersionsResponse}
     */
    listModelVersionNames(owner, name, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listModelVersionNames");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling listModelVersionNames");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query'],
        'mode': opts['mode']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListModelVersionsResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}/versions/names', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listModelVersions operation.
     * @callback module:api/ModelRegistryV1Api~listModelVersionsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListModelVersionsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List model versions
     * @param {String} owner Owner of the namespace
     * @param {String} name Entity managing the resource
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {String} opts.mode Mode the search.
     * @param {module:api/ModelRegistryV1Api~listModelVersionsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListModelVersionsResponse}
     */
    listModelVersions(owner, name, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listModelVersions");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling listModelVersions");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query'],
        'mode': opts['mode']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListModelVersionsResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}/versions', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~patchModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelRegistry} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch registry model
     * @param {String} owner Owner of the namespace
     * @param {String} model_name Optional component name, should be a valid fully qualified value: name[:version]
     * @param {module:model/V1ModelRegistry} body Model body
     * @param {module:api/ModelRegistryV1Api~patchModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelRegistry}
     */
    patchModelRegistry(owner, model_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchModelRegistry");
      }
      // verify the required parameter 'model_name' is set
      if (model_name === undefined || model_name === null) {
        throw new Error("Missing the required parameter 'model_name' when calling patchModelRegistry");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchModelRegistry");
      }

      let pathParams = {
        'owner': owner,
        'model.name': model_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ModelRegistry;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{model.name}', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchModelRegistrySettings operation.
     * @callback module:api/ModelRegistryV1Api~patchModelRegistrySettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelRegistrySettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch registry model settings
     * @param {String} owner Owner of the namespace
     * @param {String} model Model name
     * @param {module:model/V1ModelRegistrySettings} body Model settings body
     * @param {module:api/ModelRegistryV1Api~patchModelRegistrySettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelRegistrySettings}
     */
    patchModelRegistrySettings(owner, model, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchModelRegistrySettings");
      }
      // verify the required parameter 'model' is set
      if (model === undefined || model === null) {
        throw new Error("Missing the required parameter 'model' when calling patchModelRegistrySettings");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchModelRegistrySettings");
      }

      let pathParams = {
        'owner': owner,
        'model': model
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ModelRegistrySettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{model}/settings', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchModelVersion operation.
     * @callback module:api/ModelRegistryV1Api~patchModelVersionCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelVersion} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch model version
     * @param {String} owner Owner of the namespace
     * @param {String} model Model name
     * @param {String} version_name Optional component name, should be a valid fully qualified value: name[:version]
     * @param {module:model/V1ModelVersion} body Model version body
     * @param {module:api/ModelRegistryV1Api~patchModelVersionCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelVersion}
     */
    patchModelVersion(owner, model, version_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchModelVersion");
      }
      // verify the required parameter 'model' is set
      if (model === undefined || model === null) {
        throw new Error("Missing the required parameter 'model' when calling patchModelVersion");
      }
      // verify the required parameter 'version_name' is set
      if (version_name === undefined || version_name === null) {
        throw new Error("Missing the required parameter 'version_name' when calling patchModelVersion");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchModelVersion");
      }

      let pathParams = {
        'owner': owner,
        'model': model,
        'version.name': version_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ModelVersion;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{model}/versions/{version.name}', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the restoreModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~restoreModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Restore registry model
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ModelRegistryV1Api~restoreModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     */
    restoreModelRegistry(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling restoreModelRegistry");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling restoreModelRegistry");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}/restore', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the unbookmarkModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~unbookmarkModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Unbookmark registry model
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ModelRegistryV1Api~unbookmarkModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     */
    unbookmarkModelRegistry(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling unbookmarkModelRegistry");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling unbookmarkModelRegistry");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{name}/unbookmark', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateModelRegistry operation.
     * @callback module:api/ModelRegistryV1Api~updateModelRegistryCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelRegistry} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update registry model
     * @param {String} owner Owner of the namespace
     * @param {String} model_name Optional component name, should be a valid fully qualified value: name[:version]
     * @param {module:model/V1ModelRegistry} body Model body
     * @param {module:api/ModelRegistryV1Api~updateModelRegistryCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelRegistry}
     */
    updateModelRegistry(owner, model_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateModelRegistry");
      }
      // verify the required parameter 'model_name' is set
      if (model_name === undefined || model_name === null) {
        throw new Error("Missing the required parameter 'model_name' when calling updateModelRegistry");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateModelRegistry");
      }

      let pathParams = {
        'owner': owner,
        'model.name': model_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ModelRegistry;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{model.name}', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateModelRegistrySettings operation.
     * @callback module:api/ModelRegistryV1Api~updateModelRegistrySettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelRegistrySettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update registry model settings
     * @param {String} owner Owner of the namespace
     * @param {String} model Model name
     * @param {module:model/V1ModelRegistrySettings} body Model settings body
     * @param {module:api/ModelRegistryV1Api~updateModelRegistrySettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelRegistrySettings}
     */
    updateModelRegistrySettings(owner, model, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateModelRegistrySettings");
      }
      // verify the required parameter 'model' is set
      if (model === undefined || model === null) {
        throw new Error("Missing the required parameter 'model' when calling updateModelRegistrySettings");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateModelRegistrySettings");
      }

      let pathParams = {
        'owner': owner,
        'model': model
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ModelRegistrySettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{model}/settings', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateModelVersion operation.
     * @callback module:api/ModelRegistryV1Api~updateModelVersionCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ModelVersion} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update model version
     * @param {String} owner Owner of the namespace
     * @param {String} model Model name
     * @param {String} version_name Optional component name, should be a valid fully qualified value: name[:version]
     * @param {module:model/V1ModelVersion} body Model version body
     * @param {module:api/ModelRegistryV1Api~updateModelVersionCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ModelVersion}
     */
    updateModelVersion(owner, model, version_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateModelVersion");
      }
      // verify the required parameter 'model' is set
      if (model === undefined || model === null) {
        throw new Error("Missing the required parameter 'model' when calling updateModelVersion");
      }
      // verify the required parameter 'version_name' is set
      if (version_name === undefined || version_name === null) {
        throw new Error("Missing the required parameter 'version_name' when calling updateModelVersion");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateModelVersion");
      }

      let pathParams = {
        'owner': owner,
        'model': model,
        'version.name': version_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ModelVersion;
      return this.apiClient.callApi(
        '/api/v1/{owner}/registry/{model}/versions/{version.name}', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }


}
